const MysqlSession = require('koa-mysql-session');
const config = require('./config').config;

var store = new MysqlSession({
    database: config.database,
    user: config.username,
    password: config.password,
    host: config.host,
    port: config.port
});

var cookie = {
    // 2 天过期
    maxAge: 3600 * 1000 * 24 * 2,
    httpOnly: true,
    overwrite: true
}

module.exports = {
    store: store,
    cookie: cookie
}